<template>
  <div id="app">
    <router-view></router-view>
    <!-- 底部跳转区域 -->
    <van-tabbar v-model="active">
      <van-tabbar-item name="home" class="iconfont icon-index-fill" to="/home">首页</van-tabbar-item>
      <van-tabbar-item name="member" class="iconfont icon-icon_zhanghao" to="/member">会员</van-tabbar-item>
      <van-tabbar-item name="shopcar" icon="cart-o" :info="cou" to="/shopcar">购物车</van-tabbar-item>
      <van-tabbar-item name="search" icon="search" to="/search">搜索</van-tabbar-item>
    </van-tabbar>
  </div>
</template>
<script>
import { setInterval } from 'timers';
export default {
  data() {
    return {
      active: 'home',
      cou:''
    }
  },
  mounted() {
    setInterval(() => {
      this.carcount()
    }, 300);
  },
  methods: {
    carcount(){
      // console.log(this.$store.state.car,8989);
         let all=0
      this.$store.state.car.forEach(item=>{
      
         all +=item.cou
        return all
      })
       this.cou =all
    
    }
  },
 
}
</script>
